home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / lisp / stk-3.002 / stk-3 / STk-3.1 / Tk / generic / tkInt.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-31  |  29.3 KB  |  819 lines

  1. /*
  2.  * tkInt.h --
  3.  *
  4.  *    Declarations for things used internally by the Tk
  5.  *    procedures but not exported outside the module.
  6.  *
  7.  * Copyright (c) 1990-1994 The Regents of the University of California.
  8.  * Copyright (c) 1994-1996 Sun Microsystems, Inc.
  9.  *
  10.  * See the file "license.terms" for information on usage and redistribution
  11.  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  12.  *
  13.  * SCCS: @(#) tkInt.h 1.165 96/03/18 13:02:25
  14.  */
  15.  
  16. #ifndef _TKINT
  17. #define _TKINT
  18.  
  19. #ifndef _TK
  20. #include "tk.h"
  21. #endif
  22. #ifndef _TCL
  23. #include "tcl.h"
  24. #endif
  25. #ifndef _TKPORT
  26. #include <tkPort.h>
  27. #endif
  28.  
  29. /*
  30.  * Opaque type declarations:
  31.  */
  32.  
  33. typedef struct TkColormap TkColormap;
  34. typedef struct TkGrabEvent TkGrabEvent;
  35. typedef struct Tk_PostscriptInfo Tk_PostscriptInfo;
  36. typedef struct TkRegion_ *TkRegion;
  37. typedef struct TkStressedCmap TkStressedCmap;
  38.  
  39. /*
  40.  * One of the following structures is maintained for each cursor in
  41.  * use in the system.  This structure is used by tkCursor.c and the
  42.  * various system specific cursor files.
  43.  */
  44.  
  45. typedef struct TkCursor {
  46.     Tk_Cursor cursor;        /* System specific identifier for cursor. */
  47.     int refCount;        /* Number of active uses of cursor. */
  48.     Tcl_HashTable *otherTable;    /* Second table (other than idTable) used
  49.                  * to index this entry. */
  50.     Tcl_HashEntry *hashPtr;    /* Entry in otherTable for this structure
  51.                  * (needed when deleting). */
  52. } TkCursor;
  53.  
  54. /*
  55.  * One of the following structures is maintained for each display
  56.  * containing a window managed by Tk:
  57.  */
  58.  
  59. typedef struct TkDisplay {
  60.     Display *display;        /* Xlib's info about display. */
  61.     struct TkDisplay *nextPtr;    /* Next in list of all displays. */
  62.     char *name;            /* Name of display (with any screen
  63.                  * identifier removed).  Malloc-ed. */
  64.     Time lastEventTime;        /* Time of last event received for this
  65.                  * display. */
  66.  
  67.     /*
  68.      * Information used primarily by tkBind.c:
  69.      */
  70.  
  71.     int bindInfoStale;        /* Non-zero means the variables in this
  72.                  * part of the structure are potentially
  73.                  * incorrect and should be recomputed. */
  74.     unsigned int modeModMask;    /* Has one bit set to indicate the modifier
  75.                  * corresponding to "mode shift".  If no
  76.                  * such modifier, than this is zero. */
  77.     unsigned int metaModMask;    /* Has one bit set to indicate the modifier
  78.                  * corresponding to the "Meta" key.  If no
  79.                  * such modifier, then this is zero. */
  80.     unsigned int altModMask;    /* Has one bit set to indicate the modifier
  81.                  * corresponding to the "Meta" key.  If no
  82.                  * such modifier, then this is zero. */
  83.     enum {LU_IGNORE, LU_CAPS, LU_SHIFT} lockUsage;
  84.                 /* Indicates how to interpret lock modifier. */
  85.     int numModKeyCodes;        /* Number of entries in modKeyCodes array
  86.                  * below. */
  87.     KeyCode *modKeyCodes;    /* Pointer to an array giving keycodes for
  88.                  * all of the keys that have modifiers
  89.                  * associated with them.  Malloc'ed, but
  90.                  * may be NULL. */
  91.  
  92.     /*
  93.      * Information used by tkError.c only:
  94.      */
  95.  
  96.     struct TkErrorHandler *errorPtr;
  97.                 /* First in list of error handlers
  98.                  * for this display.  NULL means
  99.                  * no handlers exist at present. */
  100.     int deleteCount;        /* Counts # of handlers deleted since
  101.                  * last time inactive handlers were
  102.                  * garbage-collected.  When this number
  103.                  * gets big, handlers get cleaned up. */
  104.  
  105.     /*
  106.      * Information used by tkSend.c only:
  107.      */
  108.  
  109.     Tk_Window commTkwin;    /* Window used for communication
  110.                  * between interpreters during "send"
  111.                  * commands.  NULL means send info hasn't
  112.                  * been initialized yet. */
  113.     Atom commProperty;        /* X's name for comm property. */
  114.     Atom registryProperty;    /* X's name for property containing
  115.                  * registry of interpreter names. */
  116.     Atom appNameProperty;    /* X's name for property used to hold the
  117.                  * application name on each comm window. */
  118.  
  119.     /*
  120.      * Information used by tkSelect.c and tkClipboard.c only:
  121.      */
  122.  
  123.     struct TkSelectionInfo *selectionInfoPtr;
  124.                 /* First in list of selection information
  125.                  * records.  Each entry contains information
  126.                  * about the current owner of a particular
  127.                  * selection on this display. */
  128.     Atom multipleAtom;        /* Atom for MULTIPLE.  None means
  129.                  * selection stuff isn't initialized. */
  130.     Atom incrAtom;        /* Atom for INCR. */
  131.     Atom targetsAtom;        /* Atom for TARGETS. */
  132.     Atom timestampAtom;        /* Atom for TIMESTAMP. */
  133.     Atom textAtom;        /* Atom for TEXT. */
  134.     Atom compoundTextAtom;    /* Atom for COMPOUND_TEXT. */
  135.     Atom applicationAtom;    /* Atom for TK_APPLICATION. */
  136.     Atom windowAtom;        /* Atom for TK_WINDOW. */
  137.     Atom clipboardAtom;        /* Atom for CLIPBOARD. */
  138.  
  139.     Tk_Window clipWindow;    /* Window used for clipboard ownership and to
  140.                  * retrieve selections between processes. NULL
  141.                  * means clipboard info hasn't been
  142.                  * initialized. */
  143.     int clipboardActive;    /* 1 means we currently own the clipboard
  144.                  * selection, 0 means we don't. */
  145.     struct TkMainInfo *clipboardAppPtr;
  146.                 /* Last application that owned clipboard. */
  147.     struct TkClipboardTarget *clipTargetPtr;
  148.                 /* First in list of clipboard type information
  149.                  * records.  Each entry contains information
  150.                  * about the buffers for a given selection
  151.                  * target. */
  152.  
  153.     /*
  154.      * Information used by tkAtom.c only:
  155.      */
  156.  
  157.     int atomInit;        /* 0 means stuff below hasn't been
  158.                  * initialized yet. */
  159.     Tcl_HashTable nameTable;    /* Maps from names to Atom's. */
  160.     Tcl_HashTable atomTable;    /* Maps from Atom's back to names. */
  161.  
  162.     /*
  163.      * Information used by tkCursor.c only:
  164.      */
  165.  
  166.     Font cursorFont;        /* Font to use for standard cursors.
  167.                  * None means font not loaded yet. */
  168.  
  169.     /*
  170.      * Information used by tkGrab.c only:
  171.      */
  172.  
  173.     struct TkWindow *grabWinPtr;
  174.                 /* Window in which the pointer is currently
  175.                  * grabbed, or NULL if none. */
  176.     struct TkWindow *eventualGrabWinPtr;
  177.                 /* Value that grabWinPtr will have once the
  178.                  * grab event queue (below) has been
  179.                  * completely emptied. */
  180.     struct TkWindow *buttonWinPtr;
  181.                 /* Window in which first mouse button was
  182.                  * pressed while grab was in effect, or NULL
  183.                  * if no such press in effect. */
  184.     struct TkWindow *serverWinPtr;
  185.                 /* If no application contains the pointer then
  186.                  * this is NULL.  Otherwise it contains the
  187.                  * last window for which we've gotten an
  188.                  * Enter or Leave event from the server (i.e.
  189.                  * the last window known to have contained
  190.                  * the pointer).  Doesn't reflect events
  191.                  * that were synthesized in tkGrab.c. */
  192.     TkGrabEvent *firstGrabEventPtr;
  193.                 /* First in list of enter/leave events
  194.                  * synthesized by grab code.  These events
  195.                  * must be processed in order before any other
  196.                  * events are processed.  NULL means no such
  197.                  * events. */
  198.     TkGrabEvent *lastGrabEventPtr;
  199.                 /* Last in list of synthesized events, or NULL
  200.                  * if list is empty. */
  201.     int grabFlags;        /* Miscellaneous flag values.  See definitions
  202.                  * in tkGrab.c. */
  203.  
  204.     /*
  205.      * Information used by tkXId.c only:
  206.      */
  207.  
  208.     struct TkIdStack *idStackPtr;
  209.                 /* First in list of chunks of free resource
  210.                  * identifiers, or NULL if there are no free
  211.                  * resources. */
  212.     XID (*defaultAllocProc) _ANSI_ARGS_((Display *display));
  213.                 /* Default resource allocator for display. */
  214.     struct TkIdStack *windowStackPtr;
  215.                 /* First in list of chunks of window
  216.                  * identifers that can't be reused right
  217.                  * now. */
  218.     int idCleanupScheduled;    /* 1 means a call to WindowIdCleanup has
  219.                  * already been scheduled, 0 means it
  220.                  * hasn't. */
  221.  
  222.     /*
  223.      * Information maintained by tkWindow.c for use later on by tkXId.c:
  224.      */
  225.  
  226.  
  227.     int destroyCount;        /* Number of Tk_DestroyWindow operations
  228.                  * in progress. */
  229.     unsigned long lastDestroyRequest;
  230.                 /* Id of most recent XDestroyWindow request;
  231.                  * can re-use ids in windowStackPtr when
  232.                  * server has seen this request and event
  233.                  * queue is empty. */
  234.  
  235.     /*
  236.      * Information used by tkVisual.c only:
  237.      */
  238.  
  239.     TkColormap *cmapPtr;    /* First in list of all non-default colormaps
  240.                  * allocated for this display. */
  241.  
  242.     /*
  243.      * Information used by tkFocus.c only:
  244.      */
  245.  
  246.     struct TkWindow *focusWinPtr;
  247.                 /* Window that currently has the focus for
  248.                  * this display, or NULL if none. */
  249.     struct TkWindow *implicitWinPtr;
  250.                 /* If the focus arrived at a toplevel window
  251.                  * implicitly via an Enter event (rather
  252.                  * than via a FocusIn event), this points
  253.                  * to the toplevel window.  Otherwise it is
  254.                  * NULL. */
  255.     struct TkWindow *focusOnMapPtr;
  256.                 /* This points to a toplevel window that is
  257.                  * supposed to receive the X input focus as
  258.                  * soon as it is mapped (needed to handle the
  259.                  * fact that X won't allow the focus on an
  260.                  * unmapped window).  NULL means no delayed
  261.                  * focus op in progress. */
  262.     int forceFocus;        /* Associated with focusOnMapPtr:  non-zero
  263.                  * means claim the focus even if some other
  264.                  * application currently has it. */
  265.  
  266.     /*
  267.      * Used by tkColor.c only:
  268.      */
  269.  
  270.     TkStressedCmap *stressPtr;    /* First in list of colormaps that have
  271.                  * filled up, so we have to pick an
  272.                  * approximate color. */
  273.  
  274.     /*
  275.      * Used by tkEvent.c only:
  276.      */
  277.  
  278.     struct TkWindowEvent *delayedMotionPtr;
  279.                 /* Points to a malloc-ed motion event
  280.                  * whose processing has been delayed in
  281.                  * the hopes that another motion event
  282.                  * will come along right away and we can
  283.                  * merge the two of them together.  NULL
  284.                  * means that there is no delayed motion
  285.                  * event. */
  286.  
  287.     /*
  288.      * Miscellaneous information:
  289.      */
  290.  
  291. #ifdef TK_USE_INPUT_METHODS
  292.     XIM inputMethod;        /* Input method for this display */
  293. #endif /* TK_USE_INPUT_METHODS */
  294.     Tcl_HashTable winTable;    /* Maps from X window ids to TkWindow ptrs. */
  295. } TkDisplay;
  296.  
  297. /*
  298.  * One of the following structures exists for each error handler
  299.  * created by a call to Tk_CreateErrorHandler.  The structure
  300.  * is managed by tkError.c.
  301.  */
  302.  
  303. typedef struct TkErrorHandler {
  304.     TkDisplay *dispPtr;        /* Display to which handler applies. */
  305.     unsigned long firstRequest;    /* Only errors with serial numbers
  306.                  * >= to this are considered. */
  307.     unsigned long lastRequest;    /* Only errors with serial numbers
  308.                  * <= to this are considered.  This
  309.                  * field is filled in when XUnhandle
  310.                  * is called.  -1 means XUnhandle
  311.                  * hasn't been called yet. */
  312.     int error;            /* Consider only errors with this
  313.                  * error_code (-1 means consider
  314.                  * all errors). */
  315.     int request;        /* Consider only errors with this
  316.                  * major request code (-1 means
  317.                  * consider all major codes). */
  318.     int minorCode;        /* Consider only errors with this
  319.                  * minor request code (-1 means
  320.                  * consider all minor codes). */
  321.     Tk_ErrorProc *errorProc;    /* Procedure to invoke when a matching
  322.                  * error occurs.  NULL means just ignore
  323.                  * errors. */
  324.     ClientData clientData;    /* Arbitrary value to pass to
  325.                  * errorProc. */
  326.     struct TkErrorHandler *nextPtr;
  327.                 /* Pointer to next older handler for
  328.                  * this display, or NULL for end of
  329.                  * list. */
  330. } TkErrorHandler;
  331.  
  332. /*
  333.  * One of the following structures exists for each event handler
  334.  * created by calling Tk_CreateEventHandler.  This information
  335.  * is used by tkEvent.c only.
  336.  */
  337.  
  338. typedef struct TkEventHandler {
  339.     unsigned long mask;        /* Events for which to invoke
  340.                  * proc. */
  341.     Tk_EventProc *proc;        /* Procedure to invoke when an event
  342.                  * in mask occurs. */
  343.     ClientData clientData;    /* Argument to pass to proc. */
  344.     struct TkEventHandler *nextPtr;
  345.                 /* Next in list of handlers
  346.                  * associated with window (NULL means
  347.                  * end of list). */
  348. } TkEventHandler;
  349.  
  350. /*
  351.  * Tk keeps one of the following data structures for each main
  352.  * window (created by a call to Tk_CreateMainWindow).  It stores
  353.  * information that is shared by all of the windows associated
  354.  * with a particular main window.
  355.  */
  356.  
  357. typedef struct TkMainInfo {
  358.     int refCount;        /* Number of windows whose "mainPtr" fields
  359.                  * point here.  When this becomes zero, can
  360.                  * free up the structure (the reference
  361.                  * count is zero because windows can get
  362.                  * deleted in almost any order;  the main
  363.                  * window isn't necessarily the last one
  364.                  * deleted). */
  365.     struct TkWindow *winPtr;    /* Pointer to main window. */
  366.     Tcl_Interp *interp;        /* Interpreter associated with application. */
  367.     Tcl_HashTable nameTable;    /* Hash table mapping path names to TkWindow
  368.                  * structs for all windows related to this
  369.                  * main window.  Managed by tkWindow.c. */
  370.     Tk_BindingTable bindingTable;
  371.                 /* Used in conjunction with "bind" command
  372.                  * to bind events to Tcl commands. */
  373. #ifdef STk_CODE
  374.     TkDisplay *curDispPtr;    /* Display for last binding command invoked
  375.                  * in this application;  used only  by
  376.                  * tkBind.c. */
  377.     int curScreenIndex;        /* Index of screen for last binding command.
  378.                  * Used only by tkBind.c. */
  379.     int bindingDepth;        /* Number of active instances of Tk_BindEvent
  380.                  * in this application.  Used only by
  381.                  * tkBind.c. */
  382. #endif
  383.     struct TkFocusInfo *focusPtr;
  384.                 /* First in list of records containing focus
  385.                  * information for each top-level in the
  386.                  * application.  Used only by tkFocus.c. */
  387.     unsigned long focusSerial;    /* Serial number of last request we made to
  388.                  * change the focus.  Used to identify
  389.                  * stale focus notifications coming from the
  390.                  * X server. */
  391.     struct TkWindow *lastFocusPtr;
  392.                 /* The most recent window that was given the
  393.                  * focus via "focus" command.  Used to restore
  394.                  * the focus when we get stale FocusIn
  395.                  * events. */
  396.     struct ElArray *optionRootPtr;
  397.                 /* Top level of option hierarchy for this
  398.                  * main window.  NULL means uninitialized.
  399.                  * Managed by tkOption.c. */
  400.     Tcl_HashTable imageTable;    /* Maps from image names to Tk_ImageMaster
  401.                  * structures.  Managed by tkImage.c. */
  402.     int strictMotif;        /* This is linked to the tk_strictMotif
  403.                  * global variable. */
  404.     struct TkMainInfo *nextPtr;    /* Next in list of all main windows managed by
  405.                  * this process. */
  406. } TkMainInfo;
  407.  
  408. /*
  409.  * Tk keeps one of the following structures for each window.
  410.  * Some of the information (like size and location) is a shadow
  411.  * of information managed by the X server, and some is special
  412.  * information used here, such as event and geometry management
  413.  * information.  This information is (mostly) managed by tkWindow.c.
  414.  * WARNING: the declaration below must be kept consistent with the
  415.  * Tk_FakeWin structure in tk.h.  If you change one, be sure to
  416.  * change the other!!
  417.  */
  418.  
  419. typedef struct TkWindow {
  420.  
  421.     /*
  422.      * Structural information:
  423.      */
  424.  
  425.     Display *display;        /* Display containing window. */
  426.     TkDisplay *dispPtr;        /* Tk's information about display
  427.                  * for window. */
  428.     int screenNum;        /* Index of screen for window, among all
  429.                  * those for dispPtr. */
  430.     Visual *visual;        /* Visual to use for window.  If not default,
  431.                  * MUST be set before X window is created. */
  432.     int depth;            /* Number of bits/pixel. */
  433.     Window window;        /* X's id for window.   NULL means window
  434.                  * hasn't actually been created yet, or it's
  435.                  * been deleted. */
  436.     struct TkWindow *childList;    /* First in list of child windows,
  437.                  * or NULL if no children. */
  438.     struct TkWindow *lastChildPtr;
  439.                 /* Last in list of child windows, or NULL
  440.                  * if no children. */
  441.     struct TkWindow *parentPtr;    /* Pointer to parent window (logical
  442.                  * parent, not necessarily X parent).  NULL
  443.                  * means either this is the main window, or
  444.                  * the window's parent has already been
  445.                  * deleted. */
  446.     struct TkWindow *nextPtr;    /* Next in list of children with
  447.                  * same parent (NULL if end of
  448.                  * list). */
  449.     TkMainInfo *mainPtr;    /* Information shared by all windows
  450.                  * associated with a particular main
  451.                  * window.  NULL means this window is
  452.                  * a rogue that isn't associated with
  453.                  * any application (at present, this
  454.                  * only happens for the dummy windows
  455.                  * used for "send" communication).  */
  456.  
  457.     /*
  458.      * Name and type information for the window:
  459.      */
  460.  
  461.     char *pathName;        /* Path name of window (concatenation
  462.                  * of all names between this window and
  463.                  * its top-level ancestor).  This is a
  464.                  * pointer into an entry in
  465.                  * mainPtr->nameTable.  NULL means that
  466.                  * the window hasn't been completely
  467.                  * created yet. */
  468.     Tk_Uid nameUid;        /* Name of the window within its parent
  469.                  * (unique within the parent). */
  470.     Tk_Uid classUid;        /* Class of the window.  NULL means window
  471.                  * hasn't been given a class yet. */
  472.  
  473.     /*
  474.      * Geometry and other attributes of window.  This information
  475.      * may not be updated on the server immediately;  stuff that
  476.      * hasn't been reflected in the server yet is called "dirty".
  477.      * At present, information can be dirty only if the window
  478.      * hasn't yet been created.
  479.      */
  480.  
  481.     XWindowChanges changes;    /* Geometry and other info about
  482.                  * window. */
  483.     unsigned int dirtyChanges;    /* Bits indicate fields of "changes"
  484.                  * that are dirty. */
  485.     XSetWindowAttributes atts;    /* Current attributes of window. */
  486.     unsigned long dirtyAtts;    /* Bits indicate fields of "atts"
  487.                  * that are dirty. */
  488.  
  489.     unsigned int flags;        /* Various flag values:  these are all
  490.                  * defined in tk.h (confusing, but they're
  491.                  * needed there for some query macros). */
  492.  
  493.     /*
  494.      * Information kept by the event manager (tkEvent.c):
  495.      */
  496.  
  497.     TkEventHandler *handlerList;/* First in list of event handlers
  498.                  * declared for this window, or
  499.                  * NULL if none. */
  500. #ifdef TK_USE_INPUT_METHODS
  501.     XIC inputContext;        /* Input context (for input methods). */
  502. #endif /* TK_USE_INPUT_METHODS */
  503.  
  504.     /*
  505.      * Information used for event bindings (see "bind" and "bindtags"
  506.      * commands in tkCmds.c):
  507.      */
  508.  
  509.     ClientData *tagPtr;        /* Points to array of tags used for bindings
  510.                  * on this window.  Each tag is a Tk_Uid.
  511.                  * Malloc'ed.  NULL means no tags. */
  512.     int numTags;        /* Number of tags at *tagPtr. */
  513.  
  514.     /*
  515.      * Information used by tkOption.c to manage options for the
  516.      * window.
  517.      */
  518.  
  519.     int optionLevel;        /* -1 means no option information is
  520.                  * currently cached for this window.
  521.                  * Otherwise this gives the level in
  522.                  * the option stack at which info is
  523.                  * cached. */
  524.     /*
  525.      * Information used by tkSelect.c to manage the selection.
  526.      */
  527.  
  528.     struct TkSelHandler *selHandlerList;
  529.                 /* First in list of handlers for
  530.                  * returning the selection in various
  531.                  * forms. */
  532.  
  533.     /*
  534.      * Information used by tkGeometry.c for geometry management.
  535.      */
  536.  
  537.     Tk_GeomMgr *geomMgrPtr;    /* Information about geometry manager for
  538.                  * this window. */
  539.     ClientData geomData;    /* Argument for geometry manager procedures. */
  540.     int reqWidth, reqHeight;    /* Arguments from last call to
  541.                  * Tk_GeometryRequest, or 0's if
  542.                  * Tk_GeometryRequest hasn't been
  543.                  * called. */
  544.     int internalBorderWidth;    /* Width of internal border of window
  545.                  * (0 means no internal border).  Geometry
  546.                  * managers should not normally place children
  547.                  * on top of the border. */
  548.  
  549.     /*
  550.      * Information maintained by tkWm.c for window manager communication.
  551.      */
  552.  
  553.     struct TkWmInfo *wmInfoPtr;    /* For top-level windows, points to
  554.                  * structure with wm-related info (see
  555.                  * tkWm.c).  For other windows, this
  556.                  * is NULL. */
  557.  
  558.     /*
  559.      * Platform specific information private to each port.
  560.      */
  561.  
  562.     struct TkWindowPrivate *privatePtr;
  563. } TkWindow;
  564.  
  565. /*
  566.  * Pointer to first entry in list of all displays currently known.
  567.  */
  568.  
  569. extern TkDisplay *tkDisplayList;
  570.  
  571. /*
  572.  * Flags passed to TkMeasureChars:
  573.  */
  574.  
  575. #define TK_WHOLE_WORDS         1
  576. #define TK_AT_LEAST_ONE         2
  577. #define TK_PARTIAL_OK         4
  578. #define TK_NEWLINES_NOT_SPECIAL     8
  579. #define TK_IGNORE_TABS        16
  580.  
  581. /*
  582.  * Return values from TkGrabState:
  583.  */
  584.  
  585. #define TK_GRAB_NONE        0
  586. #define TK_GRAB_IN_TREE        1
  587. #define TK_GRAB_ANCESTOR    2
  588. #define TK_GRAB_EXCLUDED    3
  589.  
  590. /*
  591.  * The macro below is used to modify a "char" value (e.g. by casting
  592.  * it to an unsigned character) so that it can be used safely with
  593.  * macros such as isspace.
  594.  */
  595.  
  596. #define UCHAR(c) ((unsigned char) (c))
  597.  
  598. /*
  599.  * Miscellaneous variables shared among Tk modules but not exported
  600.  * to the outside world:
  601.  */
  602.  
  603. extern Tk_Uid            tkActiveUid;
  604. extern Tk_ImageType        tkBitmapImageType;
  605. extern Tk_Uid            tkDisabledUid;
  606. extern Tk_PhotoImageFormat    tkImgFmtGIF;
  607. extern void            (*tkHandleEventProc) _ANSI_ARGS_((
  608.                         XEvent* eventPtr));
  609. extern Tk_PhotoImageFormat    tkImgFmtPPM;
  610. extern TkMainInfo        *tkMainWindowList;
  611. extern Tk_Uid            tkNormalUid;
  612. extern Tk_ImageType        tkPhotoImageType;
  613. extern int            tkSendSerial;
  614.  
  615. /*
  616.  * Internal procedures shared among Tk modules but not exported
  617.  * to the outside world:
  618.  */
  619.  
  620. EXTERN char *        TkAlignImageData _ANSI_ARGS_((XImage *image,
  621.                 int alignment, int bitOrder));
  622. EXTERN int        TkAreaToPolygon _ANSI_ARGS_((double *polyPtr,
  623.                 int numPoints, double *rectPtr));
  624. EXTERN void        TkBezierPoints _ANSI_ARGS_((double control[],
  625.                 int numSteps, double *coordPtr));
  626. EXTERN void        TkBezierScreenPoints _ANSI_ARGS_((Tk_Canvas canvas,
  627.                 double control[], int numSteps,
  628.                 XPoint *xPointPtr));
  629. EXTERN void        TkBindEventProc _ANSI_ARGS_((TkWindow *winPtr,
  630.                 XEvent *eventPtr));
  631. EXTERN void        TkChangeEventWindow _ANSI_ARGS_((XEvent *eventPtr,
  632.                 TkWindow *winPtr));
  633. #ifndef TkClipBox
  634. EXTERN void        TkClipBox _ANSI_ARGS_((TkRegion rgn,
  635.                 XRectangle* rect_return));
  636. #endif
  637. EXTERN int        TkClipInit _ANSI_ARGS_((Tcl_Interp *interp,
  638.                 TkDisplay *dispPtr));
  639. EXTERN int        TkCmapStressed _ANSI_ARGS_((Tk_Window tkwin,
  640.                 Colormap colormap));
  641. EXTERN void        TkComputeTextGeometry _ANSI_ARGS_((
  642.                 XFontStruct *fontStructPtr, char *string,
  643.                 int numChars, int wrapLength, int *widthPtr,
  644.                 int *heightPtr));
  645. EXTERN void        TkConsoleCreate _ANSI_ARGS_((void));
  646. EXTERN int        TkConsoleInit _ANSI_ARGS_((Tcl_Interp *interp));
  647. EXTERN void        TkConsolePrint _ANSI_ARGS_((Tcl_Interp *interp,
  648.                 Tcl_File outFile, char *buffer, long size));
  649. EXTERN int        TkCopyAndGlobalEval _ANSI_ARGS_((Tcl_Interp *interp,
  650.                 char *script));
  651. EXTERN TkCursor *    TkCreateCursorFromData _ANSI_ARGS_((Tk_Window tkwin,
  652.                 char *source, char *mask, int width, int height,
  653.                 int xHot, int yHot, XColor fg, XColor bg));
  654. EXTERN int        TkCreateFrame _ANSI_ARGS_((ClientData clientData,
  655.                 Tcl_Interp *interp, int argc, char **argv,
  656.                 int toplevel, char *appName));
  657. EXTERN Tk_Window    TkCreateMainWindow _ANSI_ARGS_((Tcl_Interp *interp,
  658.                 char *screenName, char *baseName));
  659. #ifndef TkCreateRegion
  660. EXTERN TkRegion        TkCreateRegion _ANSI_ARGS_((void));
  661. #endif
  662. EXTERN Time        TkCurrentTime _ANSI_ARGS_((TkDisplay *dispPtr));
  663. EXTERN int        TkDeadAppCmd _ANSI_ARGS_((ClientData clientData,
  664.                 Tcl_Interp *interp, int argc, char **argv));
  665. EXTERN void        TkDeleteAllImages _ANSI_ARGS_((TkMainInfo *mainPtr));
  666. #ifndef TkDestroyRegion
  667. EXTERN void        TkDestroyRegion _ANSI_ARGS_((TkRegion rgn));
  668. #endif
  669. EXTERN void        TkDisplayChars _ANSI_ARGS_((Display *display,
  670.                 Drawable drawable, GC gc,
  671.                 XFontStruct *fontStructPtr, char *string,
  672.                 int numChars, int x, int y, int tabOrigin,
  673.                 int flags));
  674. EXTERN void        TkDisplayText _ANSI_ARGS_((Display *display,
  675.                 Drawable drawable, XFontStruct *fontStructPtr,
  676.                 char *string, int numChars, int x, int y,
  677.                 int length, Tk_Justify justify, int underline,
  678.                 GC gc));
  679. EXTERN void        TkEventCleanupProc _ANSI_ARGS_((
  680.                 ClientData clientData, Tcl_Interp *interp));
  681. EXTERN void        TkEventDeadWindow _ANSI_ARGS_((TkWindow *winPtr));
  682. EXTERN void        TkFillPolygon _ANSI_ARGS_((Tk_Canvas canvas,
  683.                 double *coordPtr, int numPoints, Display *display,
  684.                 Drawable drawable, GC gc, GC outlineGC));
  685. EXTERN void        TkFocusDeadWindow _ANSI_ARGS_((TkWindow *winPtr));
  686. EXTERN int        TkFocusFilterEvent _ANSI_ARGS_((TkWindow *winPtr,
  687.                 XEvent *eventPtr));
  688. EXTERN void        TkFreeBindingTags _ANSI_ARGS_((TkWindow *winPtr));
  689. EXTERN void        TkFreeWindowId _ANSI_ARGS_((TkDisplay *dispPtr,
  690.                 Window w));
  691. EXTERN void        TkFreeCursor _ANSI_ARGS_((TkCursor *cursorPtr));
  692. EXTERN char *        TkGetBitmapData _ANSI_ARGS_((Tcl_Interp *interp,
  693.                 char *string, char *fileName, int *widthPtr,
  694.                 int *heightPtr, int *hotXPtr, int *hotYPtr));
  695. EXTERN void        TkGetButtPoints _ANSI_ARGS_((double p1[], double p2[],
  696.                 double width, int project, double m1[],
  697.                 double m2[]));
  698. EXTERN TkCursor *    TkGetCursorByName _ANSI_ARGS_((Tcl_Interp *interp,
  699.                 Tk_Window tkwin, Tk_Uid string));
  700. EXTERN TkDisplay *    TkGetDisplay _ANSI_ARGS_((Display *display));
  701. EXTERN TkWindow *    TkGetFocus _ANSI_ARGS_((TkWindow *winPtr));
  702. EXTERN int        TkGetInterpNames _ANSI_ARGS_((Tcl_Interp *interp,
  703.                 Tk_Window tkwin));
  704. EXTERN int        TkGetMiterPoints _ANSI_ARGS_((double p1[], double p2[],
  705.                 double p3[], double width, double m1[],
  706.                 double m2[]));
  707. EXTERN void        TkGetPointerCoords _ANSI_ARGS_((Tk_Window tkwin,
  708.                 int *xPtr, int *yPtr));
  709. EXTERN char *        TkGetDefaultScreenName _ANSI_ARGS_((Tcl_Interp *interp,
  710.                 char *screenName));
  711. EXTERN void        TkGetServerInfo _ANSI_ARGS_((Tcl_Interp *interp,
  712.                 Tk_Window tkwin));
  713. EXTERN void        TkGrabDeadWindow _ANSI_ARGS_((TkWindow *winPtr));
  714. EXTERN int        TkGrabState _ANSI_ARGS_((TkWindow *winPtr));
  715. EXTERN TkWindow *          TkIDToWindow _ANSI_ARGS_((Window window, 
  716.                 TkDisplay *display));
  717. EXTERN void        TkIncludePoint _ANSI_ARGS_((Tk_Item *itemPtr,
  718.                 double *pointPtr));
  719. EXTERN void        TkInitXId _ANSI_ARGS_((TkDisplay *dispPtr));
  720. EXTERN void        TkInOutEvents _ANSI_ARGS_((XEvent *eventPtr,
  721.                 TkWindow *sourcePtr, TkWindow *destPtr,
  722.                 int leaveType, int enterType,
  723.                 Tcl_QueuePosition position));
  724. #ifndef TkIntersectRegion
  725. EXTERN void        TkIntersectRegion _ANSI_ARGS_((TkRegion sra,
  726.                 TkRegion srcb, TkRegion dr_return));
  727. #endif
  728. EXTERN char *        TkKeysymToString _ANSI_ARGS_((KeySym keysym));
  729. EXTERN int        TkLineToArea _ANSI_ARGS_((double end1Ptr[2],
  730.                 double end2Ptr[2], double rectPtr[4]));
  731. EXTERN double        TkLineToPoint _ANSI_ARGS_((double end1Ptr[2],
  732.                 double end2Ptr[2], double pointPtr[2]));
  733. EXTERN int        TkMakeBezierCurve _ANSI_ARGS_((Tk_Canvas canvas,
  734.                 double *pointPtr, int numPoints, int numSteps,
  735.                 XPoint xPoints[], double dblPoints[]));
  736. EXTERN void        TkMakeBezierPostscript _ANSI_ARGS_((Tcl_Interp *interp,
  737.                 Tk_Canvas canvas, double *pointPtr,
  738.                 int numPoints));
  739. EXTERN Window        TkMakeWindow _ANSI_ARGS_((TkWindow *winPtr,
  740.                 Window parent));
  741. EXTERN int        TkMeasureChars _ANSI_ARGS_((XFontStruct *fontStructPtr,
  742.                 char *source, int maxChars, int startX, int maxX,
  743.                 int tabOrigin, int flags, int *nextXPtr));
  744. EXTERN void        TkOptionClassChanged _ANSI_ARGS_((TkWindow *winPtr));
  745. EXTERN void        TkOptionDeadWindow _ANSI_ARGS_((TkWindow *winPtr));
  746. EXTERN int        TkOvalToArea _ANSI_ARGS_((double *ovalPtr,
  747.                 double *rectPtr));
  748. EXTERN double        TkOvalToPoint _ANSI_ARGS_((double ovalPtr[4],
  749.                 double width, int filled, double pointPtr[2]));
  750. EXTERN int        TkPlatformInit _ANSI_ARGS_((Tcl_Interp *interp));
  751. EXTERN int        TkPointerEvent _ANSI_ARGS_((XEvent *eventPtr,
  752.                 TkWindow *winPtr));
  753. EXTERN int        TkPolygonToArea _ANSI_ARGS_((double *polyPtr,
  754.                 int numPoints, double *rectPtr));
  755. EXTERN double        TkPolygonToPoint _ANSI_ARGS_((double *polyPtr,
  756.                 int numPoints, double *pointPtr));
  757. EXTERN int        TkPositionInTree _ANSI_ARGS_((TkWindow *winPtr,
  758.                 TkWindow *treePtr));
  759. #ifndef TkPutImage
  760. EXTERN void        TkPutImage _ANSI_ARGS_((unsigned long *colors,
  761.                 int ncolors, Display* display, Drawable d,
  762.                 GC gc, XImage* image, int src_x, int src_y,
  763.                 int dest_x, int dest_y, unsigned int width,
  764.                 unsigned int height));
  765. #endif
  766. #ifndef TkRectInRegion
  767. EXTERN int        TkRectInRegion _ANSI_ARGS_((TkRegion rgn,
  768.                 int x, int y, unsigned int width,
  769.                 unsigned int height));
  770. #endif
  771. EXTERN void        TkQueueEventForAllChildren _ANSI_ARGS_((
  772.                 Tk_Window tkwin, XEvent *eventPtr));
  773. EXTERN int        TkScrollWindow _ANSI_ARGS_((Tk_Window tkwin, GC gc,
  774.                 int x, int y, int width, int height, int dx,
  775.                 int dy, TkRegion damageRgn));
  776. EXTERN void        TkSelDeadWindow _ANSI_ARGS_((TkWindow *winPtr));
  777. EXTERN void        TkSelEventProc _ANSI_ARGS_((Tk_Window tkwin,
  778.                 XEvent *eventPtr));
  779. EXTERN void        TkSelInit _ANSI_ARGS_((Tk_Window tkwin));
  780. #ifndef TkSetPixmapColormap
  781. EXTERN void        TkSetPixmapColormap _ANSI_ARGS_((Pixmap pixmap,
  782.                 Colormap colormap));
  783. #endif
  784. #ifndef TkSetRegion
  785. EXTERN void        TkSetRegion _ANSI_ARGS_((Display* display, GC gc,
  786.                 TkRegion rgn));
  787. #endif
  788. EXTERN void        TkSelPropProc _ANSI_ARGS_((XEvent *eventPtr));
  789. EXTERN int        TkThickPolyLineToArea _ANSI_ARGS_((double *coordPtr,
  790.                 int numPoints, double width, int capStyle,
  791.                 int joinStyle, double *rectPtr));
  792. EXTERN KeySym        TkStringToKeysym _ANSI_ARGS_((char *name));
  793. EXTERN void        TkUnderlineChars _ANSI_ARGS_((Display *display,
  794.                 Drawable drawable, GC gc,
  795.                 XFontStruct *fontStructPtr, char *string,
  796.                 int x, int y, int tabOrigin, int flags,
  797.                 int firstChar, int lastChar));
  798. #ifndef TkUnionRectWithRegion
  799. EXTERN void        TkUnionRectWithRegion _ANSI_ARGS_((XRectangle* rect,
  800.                 TkRegion src, TkRegion dr_return));
  801. #endif
  802. EXTERN void        TkWmAddToColormapWindows _ANSI_ARGS_((
  803.                 TkWindow *winPtr));
  804. EXTERN void        TkWmDeadWindow _ANSI_ARGS_((TkWindow *winPtr));
  805. EXTERN void        TkWmMapWindow _ANSI_ARGS_((TkWindow *winPtr));
  806. EXTERN void        TkWmNewWindow _ANSI_ARGS_((TkWindow *winPtr));
  807. EXTERN void        TkWmProtocolEventProc _ANSI_ARGS_((TkWindow *winPtr,
  808.                 XEvent *evenvPtr));
  809. EXTERN void        TkWmRemoveFromColormapWindows _ANSI_ARGS_((
  810.                 TkWindow *winPtr));
  811. EXTERN void        TkWmRestackToplevel _ANSI_ARGS_((TkWindow *winPtr,
  812.                 int aboveBelow, TkWindow *otherPtr));
  813. EXTERN void        TkWmSetClass _ANSI_ARGS_((TkWindow *winPtr));
  814. EXTERN void        TkWmUnmapWindow _ANSI_ARGS_((TkWindow *winPtr));
  815. EXTERN int        TkXFileProc _ANSI_ARGS_((ClientData clientData,
  816.                 int mask, int flags));
  817.  
  818. #endif  /* _TKINT */
  819.